#ifndef _IM_SERVER_TEMP_ID_GENERATOR_
#define _IM_SERVER_TEMP_ID_GENERATOR_

#include "base/distributed_counter.h"

namespace imserver {

class TempIdGenerator {
 public:
  static TempIdGenerator & Instance() {
    static TempIdGenerator instance; 
    return instance;
  }
  int64_t Generate();
  void current_id(int64_t new_id) {
    current_id_ = new_id;
  }
 private:
  TempIdGenerator();
  base::DistributedCounter dist_counter_;
  int64_t current_id_;
};

}

#endif // _IM_SERVER_TEMP_ID_GENERATOR_

